package com.example.martian.controller;

import com.example.martian.service.MessageService;
import jnr.ffi.annotations.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@RequestMapping("/notice/")
@CrossOrigin
public class MessageController {

    @Autowired
    private MessageService messageService;

    @ResponseBody
    @RequestMapping(value = "selectNoticeAll")
    public Object selectNoticeAll(){
        return messageService.selectNoticeAll();
    }

    @ResponseBody
    @RequestMapping(value = "selectNoticeById")
    public Object selectNoticeById(Integer noticeId){
        return messageService.selectNoticeById(noticeId);
    }
}
